package com.happymmall.dao;

import com.happymmall.entity.User;

import java.sql.Connection;
import java.sql.SQLException;

public interface UserDao {

    // 得到要登录的用户
    public User getLoginUser(Connection connection, String password, String username) throws SQLException;

    // 注册
    public int registerUser(Connection connection, User user) throws SQLException;

    //判断用户名或邮箱是否存在
    public boolean checkvalid(Connection connection, String str, String type) throws SQLException;

    //获取用户的登录信息
    public User get_user_info(Connection connection, int id) throws SQLException;

    //获取问题
    public String forget_get_question(Connection connection, String username) throws SQLException;

    //提交问题答案
    public boolean forget_check_answer(Connection connection, String username, String question, String answer) throws SQLException;

    //忘记密码的重设密码
    public int forget_reset_password(Connection connection, String passwordNew, String username) throws SQLException;

    //登录状态中修改密码
    public int reset_password(Connection connection, Integer id, String passwordOld, String passwordNew) throws SQLException;

    //登录状态中修改密码
    public int update_information(Connection connection, String email, String phone, String question, String answer, Integer id) throws SQLException;


}
